#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
class Solution {
public:
    int divide(int dividend, int divisor) {
        if (!dividend)return 0;
        if (divisor==1)return dividend;
        if (divisor == -1)
        {
            if (dividend > INT_MIN) return -dividend;
            return INT_MAX;
        }
        long long a, b;
        a = dividend;
        b = divisor;
        bool pd = 0;
        if (a < 0)pd = !pd, a = -a;
        if (b < 0)pd = !pd, b = -b;
        int ans = div(a, b);
        return pd ? -ans : ans;
    }
    int div(long long a, long long b)
    {
        if (a < b)return 0;
        if (a == b)return 1;
        long long bt = b;
        long long ans = 1;
        while (a > b + b)ans += ans, b += b;
        if (a == b + b)return ans + ans;
        return div(a - b, bt) + ans;


    }
};
int main()
{
	Solution sol;
}